home *** CD-ROM | disk | FTP | other *** search
/ Mac OS 9 Serial Number Archive / SN Archive 2023.11.04.toast / BSNG / SDK / BSNG SDK 2.5 / Libraries / UltraLibU / UltraU.h < prev   
Encoding:
C/C++ Source or Header  |  1998-02-05  |  2.7 KB  |  79 lines  |  [TEXT/CWIE]

  1. /*
  2.  * $Workfile:: UltraU.h                                                       $
  3.  * $Revision:: 1                                                              $
  4.  *
  5.  * $Author:: Buck Rogers                                                      $
  6.  * $Modtime:: 30.09.1997 17:50 Uhr                                            $
  7.  *
  8.  * $History:: UltraU.h                                                        $
  9.  * 
  10.  * *****************  Version 1  *****************
  11.  * User: Buck Rogers  Date: 30.09.1997   Time: 18:31 Uhr
  12.  * Created in $/BSNG/Plugins/BSNG SDK/Libraries/UltraLibU
  13.  * Adding subproject 'BSNG' to '$/'
  14.  *
  15.  * $NoKeywords::                                                              $
  16.  */
  17.  
  18.  
  19. #pragma once
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. /* UltraU.h -- This header file is an essential component of the UltraLibU library.
  26.  
  27.  ***** WARNING! *************** WARNING! *************** WARNING! ******
  28.  
  29.  You MUST call Ultra_Init() before using UltraLibU!  Also, you MUST supply
  30.  values for Ultra_seed1 and Ultra_seed2 (both > 0) BEFORE calling
  31.  Ultra_Init(). Ultra_Init() ends by calling Ultra_SaveStart(). */
  32.  
  33. extern unsigned long Ultra_seed1,Ultra_seed2;
  34.  
  35. Boolean Ultra_Init();
  36.  
  37. /* Ultra_Remember is really a non-long structure of 324 bytes.  It is
  38.    defined here to facilitate saving to a file and restoring later. */
  39.  
  40. extern unsigned long Ultra_Remember[81];
  41.  
  42. /**********************************************************************/
  43.  
  44. /****** Function                                Return value **********/      
  45.  
  46. long Ultra_long32();                    /* U[-2147483648,2147483647] */
  47. long Ultra_long31();                    /* U[0,2147483647] */
  48.  
  49. short Ultra_short16();                    /* U[-32768,32767] */
  50. short Ultra_short15();                    /* U[0,32767] */
  51.  
  52. short Ultra_short8();                    /* (short) U[-128,127] */
  53. short Ultra_short8u();                    /* (short) U[0,255] */
  54. short Ultra_short7();                    /* (short) U[0,127] */
  55.  
  56. short Ultra_short1();                    /* (short) U[0,1] */
  57.  
  58. float Ultra_uni();                        /* U(0,1) with ≥ 25-bit mantissa */
  59. float Ultra_vni();                        /* U(-1,1) but excluding zero */
  60.  
  61. double Ultra_duni();                    /* U[0,1) with ≤ 63-bit mantissa */
  62. double Ultra_dvni();                    /* U(-1,1) with ≤ 63-bit mantissa */
  63.  
  64. float Ultra_norm(float mu,float sigma);    /* Normal(mean,std. dev. > 0) */
  65. float Ultra_expo(float mu);                /* Exponential(mean > 0) */
  66.  
  67. /**********************************************************************/
  68.  
  69. /* The following functions are provided in order to allow you to reproduce
  70. a sequence of random numbers, e.g., for duplicating a Monte Carlo simulation
  71. exactly.  Ultra_Init() must be called BEFORE either of these two functions. */
  72.  
  73. void Ultra_SaveStart();                    /* also called by Ultra_Init() */
  74. void Ultra_RecallStart();
  75.  
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79.